//V2.2.2 2021-9-22

//跳转手机函数

var mobileAgent = new Array("iphone", "ipod", "android", "mobile", "blackberry", "webos", "incognito", "webmate",

    "bada", "nokia", "lg", "ucweb", "skyfire");

var browser = navigator.userAgent.toLowerCase();

var isMobile = false;

for (var i = 0; i < mobileAgent.length; i++) {

    if (browser.indexOf(mobileAgent[i]) != -1) {

        isMobile = true;

        break;

    }

}

if (isMobile) {
    if(location.href.indexOf("mobile.php") == -1 && location.href.indexOf("index.php") == -1){
        location.href = 'mobile.php';
    }
    else if (location.href.indexOf("mobile.php") == -1 ) {
        
        location.href = location.href.replace('index.php','mobile.php');
    }
    
}
else {
    if(location.href.indexOf("mobile.php") == -1 && location.href.indexOf("index.php") == -1){
        location.href = 'index.php';
    }
    
    else if (location.href.indexOf("index.php") == -1) {
        location.href = location.href.replace('mobile.php','index.php');
    }
    
}
